<%@ page import="com.mastercard.Voucher" %>



<div class="fieldcontain ${hasErrors(bean: voucherInstance, field: 'description', 'error')} ">
	<label for="description">
		<g:message code="voucher.description.label" default="Description" />
		
	</label>
	<g:textField name="description" value="${voucherInstance?.description}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: voucherInstance, field: 'name', 'error')} ">
	<label for="name">
		<g:message code="voucher.name.label" default="Name" />
		
	</label>
	<g:textField name="name" value="${voucherInstance?.name}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: voucherInstance, field: 'point', 'error')} required">
	<label for="point">
		<g:message code="voucher.point.label" default="Point" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="point" required="" value="${fieldValue(bean: voucherInstance, field: 'point')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: voucherInstance, field: 'quantity', 'error')} required">
	<label for="quantity">
		<g:message code="voucher.quantity.label" default="Quantity" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="quantity" required="" value="${fieldValue(bean: voucherInstance, field: 'quantity')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: voucherInstance, field: 'redeemed', 'error')} required">
	<label for="redeemed">
		<g:message code="voucher.redeemed.label" default="Redeemed" />
		<span class="required-indicator">*</span>
	</label>
	<g:field type="number" name="redeemed" required="" value="${fieldValue(bean: voucherInstance, field: 'redeemed')}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: voucherInstance, field: 'redeemedVouchers', 'error')} ">
	<label for="redeemedVouchers">
		<g:message code="voucher.redeemedVouchers.label" default="Redeemed Vouchers" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${voucherInstance?.redeemedVouchers?}" var="r">
    <li><g:link controller="redeemedVoucher" action="show" id="${r.id}">${r?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="redeemedVoucher" action="create" params="['voucher.id': voucherInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'redeemedVoucher.label', default: 'RedeemedVoucher')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: voucherInstance, field: 'validFrom', 'error')} required">
	<label for="validFrom">
		<g:message code="voucher.validFrom.label" default="Valid From" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="validFrom" precision="day"  value="${voucherInstance?.validFrom}"  />
</div>

<div class="fieldcontain ${hasErrors(bean: voucherInstance, field: 'validTo', 'error')} required">
	<label for="validTo">
		<g:message code="voucher.validTo.label" default="Valid To" />
		<span class="required-indicator">*</span>
	</label>
	<g:datePicker name="validTo" precision="day"  value="${voucherInstance?.validTo}"  />
</div>

